<template>
	<view class="all">
		<view class="zm">
			<input v-model="zhang" placeholder="账号"/>
		    <input v-model="mi" placeholder="密码"/>
		</view>
		
		 <button class="login" type="primary" @click="denglu" > 登录</button>
		 <div class="zhuce" @click="zhuce">注册</div>
	
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				zhang:'',
				mi:''
			}
		},
		
		methods: {
			denglu(){
				uni.request({
					url:"http://124.221.104.5:8080/jbgn/denglu",
					data:{zhang:this.zhang,mi:this.mi},
					success:(res)=>{
		
						if(res.data=="密码正确")
						{uni.redirectTo({url:"/pages/index/yemian/zhuye"})
						getApp().globalData.zhang=this.zhang}
						else{
							uni.showToast({
								title: res.data,
								    icon: 'none',
								    duration: 2000,
							
							})
						}
						console.log(getApp().globalData.zhang)
					},
					
				});
			},
			zhuce(){
				uni.redirectTo({url:"/pages/index/dlzc/zhuce"})
			}
		}
	}
</script>

<style>
      .all{
		  display: flex;
		  flex-direction: column;
		  align-items: center;
		  margin-top: 250rpx;
		  width: 100%;
	   }
	   .zm input{
		   width:400rpx ;
		   height: 60rpx;
		  border: 3rpx solid antiquewhite;
		  border-radius: 15rpx;
		  margin-top: 10rpx;
	   }
	   .login{
		   margin-top: 30rpx;
		   margin-left: 290rpx;
		   width: 200rpx;
	   }
	   .zhuce{
		   position: absolute;
		    top: 410rpx; 
		   left: 190rpx;
		   font-size: 35rpx;
		   
	   }
	  
	   
</style>
